<h1 class="page-title"> <i class="icon-list font-green-sharp"></i> {{appServ.pageTitle}} </h1>
<div class="toolbar">
    <div class="page-bar">
        <ul class="page-breadcrumb float-right">
            <li>
                <i class="fa fa-home"></i>
                <a href="#/home.html">管理中心</a>
                <i class="fa fa-angle-right"></i>
            </li>
            <li>
                <a href="javascript:;">{{appServ.pageTitle}}</a>
            </li>
        </ul>
        <a [routerLink]="['/index/categoryEdit']" class="btn blue"> <i class="fa fa-plus"></i> 添加</a>
        <button *ngIf="SortChange" (click)="SortSave()" class="btn yellow"> <i class="fa fa-list-ol"></i> 保存排序</button>
    </div>
</div>
<div class="datalist" *ngIf="categorys.length>0">
    <tree-root [nodes]="categorys" [options]="options" (moveNode)="SortChange=true">
        <ng-template #treeNodeWrapperTemplate let-node let-index="index">
            <div class="node-wrapper" [style.padding-left]="node.getNodePadding()+10">
                <div class="node-content-wrapper" [class.node-content-wrapper-active]="node.isActive" [class.node-content-wrapper-focused]="node.isFocused" (click)="node.mouseAction('click', $event)" (dblclick)="node.mouseAction('dblClick', $event)" (contextmenu)="node.mouseAction('contextMenu', $event)"
                    (treeDrop)="node.onDrop($event)" [treeAllowDrop]="node.allowDrop" [treeDrag]="node" [treeDragEnabled]="node.allowDrag()">
                    <div class="btn-group float-right">
                        <a [routerLink]="['/index/categoryEdit']" [queryParams]="{ id: node.data.Id }" class="btn green">修改</a>
                        <button (click)="itemDelete(node.data)" [disabled]="node.data.children.length>0" class="btn btn-danger">删除</button>
                    </div>
                    <tree-node-expander [node]="node"></tree-node-expander>
                    <span class="note-name">{{ node.data.CategoryName }}</span>
                </div>
            </div>
        </ng-template>
    </tree-root>
</div>
<div class="nodata" *ngIf="categorys.length==0">
    <div class="alert alert-info">
        <i class="fa fa-info-circle fa-fw fa-2x"></i> 没有{{appServ.pageTitle}}数据
    </div>
</div>